package com.dh.offer;

public class DrawTaskLine {

    public static void main(String[] args) {
        DrawTaskLine d = new DrawTaskLine();
        while (true){
            long now = System.currentTimeMillis();
            while (System.currentTimeMillis() < now + 500){
                System.out.println(111);
            }
            synchronized (d) {
                try {
                    d.wait(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println(System.currentTimeMillis());
        }
    }
}
